<%@ include file="/WEB-INF/views/taglib.jsp" %>

<h3>Company Form</h3>	
	<form:form id="form" method="post" modelAttribute="department"  cssClass="simpleForm">
		<form:hidden path="departmentId" />
		<form:hidden path="active" />
		<div class="clear" style="height:1px">&nbsp;</div>
		<jsp:include page="/WEB-INF/views/message.jsp"></jsp:include>
	  	<fieldset>
	  		<legend>Company Info</legend>
	  		<p>
	  		<aims:column cssErrorClass="error" path="departmentCode" >
	  		<form:label path="departmentCode">
	  			Company Code  * 
	 		</form:label>
	  		<form:input path="departmentCode" /> <form:errors path="departmentCode"  cssClass="errorSimple" /> 
			</aims:column>
			<aims:column cssErrorClass="error" path="departmentName" >
	  		<form:label path="departmentName">
	  			Company Name * 
	 		</form:label>
	  		<form:input path="departmentName" /> <form:errors path="departmentName"  cssClass="errorSimple" />	 
			</aims:column>
			<aims:column cssErrorClass="error" path="departmentName" >
	  		<form:label path="departmentName">
	  			Unit No * 
	 		</form:label>
	  		<form:input path="departmentUnitNo" /> <form:errors path="departmentUnitNo"  cssClass="errorSimple" />	 
			</aims:column>
			<aims:column cssErrorClass="error" path="departmentContact" >
	  		<form:label path="departmentContact">
	  			Contact
	 		</form:label>
	  		<form:input path="departmentContact" /> <form:errors path="departmentContact"  cssClass="errorSimple" />	 
			</aims:column>
			</fieldset>
	  	
	  	
      <div class="action">
	  	<c:choose>
	  		<c:when test="${department.departmentId==null}">
	  			<button type="submit" class="button positive">
	  			Save
	  			</button>
	  			<a href="<c:url value="/department/search" />" class="button">Back</a>
	  		</c:when>
	  		<c:when test="${department.departmentId!=null}">
  				<button type="submit"  class="button positive">
  				Update
  				</button>
  				<a href="<c:url value="/department/search" />" class="button">Back</a>
	  		</c:when>
	  	</c:choose>
	 </div>	
	</form:form>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
	</script>